$("#searchService").click(function () {
    $(".menu").toggle()
})
mapLoad($("#stationSearch"))

function mapLoad(){
    $("#service-context").attr("style","display: none")
    $("#stationSearch").addClass("span-click")
}

function  mapClick(title){
    $(title).click(function (e) {
        $("#service-map").attr("style","display: block")
        $("#service-context").attr("style", "display: none")
        $(".title").removeClass("span-click")
        var target= $(e.target)
        $(target).addClass("span-click")
        var src=$(title).attr("name")
        $("#service-map").attr("src", src)

    })
}
function ajaxload(local){
        htmlobj=$.ajax({url:local,async:false});
        $("#service-context").html(htmlobj.responseText);
    }


$("#sendService").click(function () {
    // window.location.href= url +"booking_delivery.html"
})

function titleChange(title){
    $(title).click(function (e) {
        $("#service-context").attr("style","display: block")
        $("#service-map").attr("style","display: none")
        $(".title").removeClass("span-click")
        var target= $(e.target)
        $(target).addClass("span-click")
        var html=$(title).attr("name")
        ajaxload(html)
    })
}


titleChange($("#pageSearch"))
titleChange($("#freeSearch"))
titleChange($("#contrabandSearch"))
mapClick($("#stationSearch"))


